﻿/**
 * 
 * @file FITKSEASubSysBeam.h
 * @brief 梁子系统声明
 * @author LiBaojun (libaojunqd@foxmail.com)
 * @date 2024-10-15
 * 
 */
#ifndef _FITK_BEAM_SEA_SUB_SYS_H___
#define _FITK_BEAM_SEA_SUB_SYS_H___

#include "FITKAbstractSEASubSysWithNodes.h"
#include "FITKSEASubSysBeamWare.h"

namespace Interface
{
    class FITKAbsGeoCommand;
}

namespace Acoustics
{
    class FITKAcousticsAbstractSpectra;
    /**
     * @brief 梁子系统
     * @author LiBaojun (libaojunqd@foxmail.com)
     * @date 2024-10-15
     */
    class FITKAcousticsModelAPI FITKSEASubSysBeam :
        public FITKAbstractSEASubSysWithNodes, public FITKSEASubSysBeamWare
    {
        FITKCLASS(Acoustics, FITKSEASubSysBeam);
    public:
        /**
         * @brief Construct a new FITKSEASubSysBeam object
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-15
         */
        explicit FITKSEASubSysBeam() = default;
        /**
         * @brief Destroy the FITKSEASubSysBeam object
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-15
         */
        virtual ~FITKSEASubSysBeam() = default;
        /**
         * @brief 获取子系统类型
         * @return SEASubSysType
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-06
         */
        virtual SEASubSysType getSEASubSysType() override;
        /**
         * @brief    拷贝函数 拷贝face但不拷贝里面的单元和节点列表
         * @param[i] copyData 数据对象
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-03-04
         */
        virtual void copy(FITKAbstractSEASubSys* copyData) override;
        /**
         * @brief    获取弯曲波X频谱ID
         * @return   int     弯曲波X频谱ID
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-04
         */
        int getFlexureXSpectraID();
        /**
         * @brief    获取弯曲波X频谱
         * @return   FITKAcousticsAbstractSpectra *    获取弯曲波X频谱
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-04
         */
        FITKAcousticsAbstractSpectra* getFlexureXSpectra();
        /**
         * @brief    设置弯曲波X频谱ID
         * @param[i] id       弯曲波X频谱ID
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-04
         */
        void setFlexureXSpectraID(int id);
        /**
         * @brief    获取弯曲波Y频谱ID
         * @return   int     弯曲波Y频谱ID
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-04
         */
        int getFlexureYSpectraID();
        /**
         * @brief    获取弯曲波Y频谱
         * @return   FITKAcousticsAbstractSpectra *    获取弯曲波Y频谱
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-04
         */
        FITKAcousticsAbstractSpectra* getFlexureYSpectra();
        /**
         * @brief    设置弯曲波Y频谱ID
         * @param[i] id       弯曲波Y频谱ID
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-04
         */
        void setFlexureYSpectraID(int id);
        /**
         * @brief    获取拉伸波Z频谱ID
         * @return   int     拉伸波Z频谱ID
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-04
         */
        int getExtensionZSpectraID();
        /**
         * @brief    获取拉伸波Z频谱
         * @return   FITKAcousticsAbstractSpectra *    获取拉伸波Z频谱
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-04
         */
        FITKAcousticsAbstractSpectra* getExtensionZSpectra();
        /**
         * @brief    设置伸波Z频谱ID
         * @param[i] id       伸波Z频谱ID
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-04
         */
        void setExtensionZSpectraID(int id);
        /**
         * @brief    获取扭转波ZZ频谱ID
         * @return   int     扭转波ZZ频谱ID
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-04
         */
        int getTorsionZZSpectraID();
        /**
         * @brief    获取扭转波ZZ频谱
         * @return   FITKAcousticsAbstractSpectra *    获取扭转波ZZ频谱
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-04
         */
        FITKAcousticsAbstractSpectra* getTorsionZZSpectra();
        /**
         * @brief    设置扭转波ZZ频谱ID
         * @param[i] id       扭转波ZZ频谱ID
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-04
         */
        void setTorsionZZSpectraID(int id);

        /**
        * @brief 更新局部坐标系
        * @return bool
        * @author LiBaojun (libaojunqd@foxmail.com)
        * @date 2024-11-13
        */
        virtual bool updateCoordinate() override;
        /**
         * @brief    通过index的梁单元的占比获取位置
         * @param[i] index 
         * @param[i] percentage 
         * @param[o] location 
         * @return   bool 状态
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-12-23
         */
        bool getConnectionLocationBySegment(int index, double percentage, double* location);
        /**
         * @brief    通过位置获取梁的第几个单元和占比
         * @param[i] location 
         * @param[o] index 
         * @param[o] percentage 
         * @return   bool 状态
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-12-23
         */
        bool getSegmentByConnectionLocation(double* location, int& index, double& percentage);
        /**
         * @brief    几何线更新梁数据
         * @param[i] geoObj
         * @param[i] lineVirTopoID
         * @param[i] dire 方向
         * @return   bool 状态
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-12-23
         */
        bool updateBeam(Interface::FITKAbsGeoCommand* geoObj, int lineVirTopoID, double* dire);
        /**
         * @brief    梁单元更新梁数据
         * @param[i] beamMeshData
         * @param[i] dire 方向
         * @return   bool 状态
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-12-23
         */
        bool updateBeam(QHash<int, QList<int>> beamMeshData, double* dire);

    protected:
        /**
         * @brief  弯曲波X频谱ID
         * @author BaGuijun (baguijun@163.com)
         * @date   2024-11-04
         */
        int _flexureXSpectraID = -1;
        /**
         * @brief  弯曲波Y频谱ID
         * @author BaGuijun (baguijun@163.com)
         * @date   2024-11-04
         */
        int _flexureYSpectraID = -1;
        /**
         * @brief  拉伸波Z频谱ID
         * @author BaGuijun (baguijun@163.com)
         * @date   2024-11-04
         */
        int _extensionZSpectraID = -1;
        /**
         * @brief  扭转波ZZ频谱ID
         * @author BaGuijun (baguijun@163.com)
         * @date   2024-11-04
         */
        int _torsionZZSpectraID = -1;

    private:
    };
}


#endif
